package com.sdnu.iosclub.qvs.controller;

import com.sdnu.iosclub.serviceutil.R;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: Zhao YunLai
 * @Date: 2022/09/23/23:30
 * @Description:
 */
@RestController
@RequestMapping("/qvs")
public class LoginController {

    // login
    @PostMapping("login")
    public R login() {

        return R.ok().data("token", "admin");
    }

    // info
    @GetMapping("info")
    public R info() {

        return R.ok().data("roles", "[admin]").data("name", "admin").data("avatar", "https://fanyi-cdn.cdn.bcebos.com/static/translation/img/header/logo_40c4f13.svg");
    }

    @PostMapping ("logout")
    public R logout(){
        return R.ok();
    }
}
